/**
 * 用户操作日志管理页面js
 * 版权所有：上海戈品投资管理有限公司
 *   author king
     功能说明：用户操作日志
     创建日期：2015-10-19
     修改记录：
     备注说明：
 */

$(document).ready(function() {
	var type = $('#operType').val();
	$('#userOpType').val(type);
	userOperateLogs();
});


/**
 * 查询操作日志
 * @returns
 */
var userOperateLogs = function(){
	
	var nickName = $('#nickName').val();
	var userOpTime = $('#userOpTime').val();
	var userOpType = $('#userOpType').val();
	 
	 
	var datas =  {"p":"redPackActiveManage","m":"userOperateLog","nickName":nickName,"userOpTime":userOpTime,"userOpType":userOpType};
	var columnDefine = {"id":"编号","userName":"用户昵称","realName":"真实姓名","createTime":"操作时间","type":"操作类型","action":"操作","ip":"ip"};
	
	var formatters={
	            "createTime": function (column, rowData)
	            {
       				var newTime= new Date(rowData.createTime*1000);
       				var rowText=newTime.getFullYear()+'-'+getTheSureTime((newTime.getMonth()+1))+'-'
       				+getTheSureTime(newTime.getDate())+' '+getTheSureTime(newTime.getHours())+':'
       				+getTheSureTime(newTime.getMinutes())+':'+getTheSureTime(newTime.getSeconds());
       				return rowText;
	            },
	            "type": function (column, rowData)
	            {
    				var OPLX="";
    				switch(rowData.type){
    				case 1:
    					OPLX="提交网页数据";
    					break;
    				case 2:
    					OPLX="微信消息";
    					break;
    				case 3:
    					OPLX="进入网页";
    					break;
    				}
    				return OPLX;
	            }
	 };
	 var buttons =''; //操作按钮
		buttons+='<p>';
		//buttons+='<button type=\'button\' class=\'btn btn-w-m btn-info\' onclick="statusReset();">设置/取消可疑</button>&nbsp;&nbsp;';
		buttons+='</p>';
	   hui.pager('service',datas ,"dataList", columnDefine , formatters , buttons ); //分页查询
	
};

var getTheSureTime=function(emp){
	return emp>9?emp:"0"+emp;
};


